<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <link id="icon" rel="shortcut icon" href="favicon/orginone.ico" type="image/x-icon" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  </head>
  <body>
    <script>
      /* HACK: 部分依赖（如@bable/types）需要访问process.env来检查参数；
       * 而monaco-editor需要通过通过是否存在process对象来检查是否node环境，并调整部分功能的实现（如粘贴），
       * 见monaco-editor/esm/vs/base/common/platform.js
       * 
       * 通过暴露特殊的配置对象骗过MonacoEditor强制使其判断为web环境
       */
      (() => {
        let p = '';
        p.versions = null;
        
        window.vscode = {
          process: p,
        };
      })()

      if (typeof window.__REACT_DEVTOOLS_GLOBAL_HOOK__ === "object") {
        window.console = new Proxy(window.console, {
          set(_, p) {
            // 阻止react devtool hook console方法
            return false;
          }
        });
      }

    </script>
    <script type="module">
      import Buffer from 'buffer';
      window.Buffer = Buffer;
    </script>
    <div id="root"></div>
    <script type="text/javascript">
      (function() {
        const shortcut = document.getElementById('icon');
        const names = window.location.hostname.split('.');
        if (names.length > 0) {
          switch (names[0]) {
            case 'anxinwu':
              document.title = '安心屋';
              shortcut.setAttribute('href', 'favicon/anxinwu.ico');
              return;
            case 'gongyicang':
              document.title = '公益仓';
              shortcut.setAttribute('href', 'favicon/gongyicang.ico');
              return;
            case 'asset':
              document.title = '资产共享云';
              shortcut.setAttribute('href', 'favicon/asset.ico');
              return;
            case 'assetcloud':
              document.title = '资产共享云';
              shortcut.setAttribute('href', 'favicon/asset.ico');
              return;
            case 'dataexp':
              document.title = '数据资产治理实验平台';
              shortcut.setAttribute('href', 'favicon/dataexp.ico');
              return;
            case 'ocia':
              document.title = '资产云开放协同创新中心';
              shortcut.setAttribute('href', 'favicon/ocia.ico');
              return;
            case 'apparatus':
              document.title = '大型科研仪器共享平台';
              shortcut.setAttribute('href', 'favicon/apparatus.ico');
              return;
            case 'company':
              document.title = '校企监管平台';
              shortcut.setAttribute('href', 'favicon/company.ico');
              return;
          }
        }
        document.title = '奥集能';
      })();
    </script>
    <script type="module" src="/src/index.tsx"></script>
  </body>
</html>
